#include<iostream>
using namespace std;
#include<string>
/*

*/
class Building;
class GoodGay
{
public:
    GoodGay();
    void visit();//参观函数访问Building中的属性
    Building *building;
};
class Building
{
    //GoodGay类是本来的好朋友，可以访问本类中的私有成员
    friend class GoodGay;
public:
    Building();
    string m_SittingRoom;
private:
    string m_BedRoom;
};
//类外写构造哦函数
Building::Building()
{
    m_SittingRoom="客厅";
    m_BedRoom="卧室";
}
GoodGay::GoodGay()
{
    //创建建筑物对象
    building = new Building;
}
void GoodGay::visit()
{
    cout<<"好基友类正在访问："<<building->m_SittingRoom<<endl;
    cout<<"好基友类正在访问："<<building->m_BedRoom<<endl;
}
void test01()
{
    GoodGay gg;
    gg.visit();
}
int main()
{
    test01();
}